<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>活动列表</title>
  <link rel="stylesheet" href="/static/css/font.css">
  <link rel="stylesheet" href="/static/css/index.css">
  <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
  <script type="text/javascript" src="/static/js/index.js"></script>
</head>
<body>
<div class="x-nav">
  <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
    <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-body ">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach" type="submit" onclick="pendingReview(0)"><i class="layui-icon">未开始</i></button>
          <button class="layui-btn"  lay-submit="" lay-filter="sreach" type="submit" onclick="pendingReview(1)"><i class="layui-icon">已开始</i></button>
          <button class="layui-btn"  lay-submit="" lay-filter="sreach" type="submit" onclick="pendingReview(2)"><i class="layui-icon">已结束</i></button>
          <button class="layui-btn"  lay-submit="" lay-filter="sreach" type="submit" onclick="pendingReview(3)"><i class="layui-icon">已删除</i></button>
          <button class="layui-btn"  lay-submit="" lay-filter="sreach" type="submit" onclick="allActivities()"><i class="layui-icon">所有</i></button>
        </div>
        <div class="layui-card-body layui-table-body layui-table-main">
          <table class="layui-table layui-form" align="center">
            <thead >
            <tr>
              <th>ID</th>
              <th>活动主题</th>
              <th>开始时间</th>
              <th>结束时间</th>
<!--              <th>活动地点</th>-->
              <th>活动人数</th>
<!--              <th>空余人数</th>-->
              <th>活动费用</th>
<!--              <th>收藏数量</th>-->
<!--              <th>活动内容</th>-->
              <th>状态</th>
              <th>操作</th></tr>
            </thead>
            <tbody >
            <tr  th:each="list,listStat:${activityList}">
              <td th:text="${listStat.index+1}"></td>
              <td th:text="${list.activityTitle}" style="max-width: 100px;overflow: hidden; text-overflow:ellipsis;white-space: nowrap" ></td>
              <td th:text="${list.activityStartTime}" style="max-width: 100px;overflow: hidden; text-overflow:ellipsis;white-space: nowrap"></td>
              <td th:text="${list.activityEndTime}" style="max-width: 100px;overflow: hidden; text-overflow:ellipsis;white-space: nowrap"></td>
<!--              <td th:text="${list.activityAddress}"></td>-->
              <td th:text="${list.activityNumber}"></td>
<!--              <td th:text="${list.activitySpare}"></td>-->
              <td th:text="${list.activityFee}"></td>
<!--              <td th:text="${list.activityLike}"></td>-->
<!--              <td th:text="${list.activityContent}" style="max-width: 100px;overflow: hidden; text-overflow:ellipsis;white-space: nowrap"></td>-->
              <td class="td-status">
                <span class="layui-btn layui-btn-warm layui-btn-mini layui-btn-xs"  th:if="${list.activityStatus} == 0">未开始</span>
                <span class="layui-btn layui-btn-normal layui-btn-mini layui-btn-xs"  th:if="${list.activityStatus} == 1">已开始</span>
                <span class="layui-btn layui-btn-danger layui-btn-mini layui-btn-xs"  th:if="${list.activityStatus} == 2">已结束</span>
                <span class="layui-btn layui-btn-danger layui-btn-mini layui-btn-xs"  th:if="${list.activityStatus} == 3">已删除</span></td>
              <td class="td-manage">
                <a title="查看详情" th:onclick="member_look(this,[[${list.activityId}]])" href="javascript:;">
                  <button class="layui-btn layui-btn-normal layui-btn-mini  layui-btn-xs" style="padding-top: 3px;">
                    <svg t="1662547909260" class="icon" viewBox="0 0 1028 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3599" width="16" height="16"><path d="M1024.007782 34.863813v631.533074c0 19.224903-15.638911 34.863813-34.863813 34.863813s-34.863813-15.638911-34.863813-34.863813V69.727626H69.735409v884.544748h596.66926c19.224903 0 34.863813 15.638911 34.863813 34.863813s-15.638911 34.863813-34.863813 34.863813H34.871595c-19.224903 0-34.863813-15.638911-34.863813-34.863813V34.863813C0.007782 15.638911 15.646693 0 34.871595 0h954.272374c19.224903 0 34.863813 15.638911 34.863813 34.863813z" p-id="3600" fill="#ffffff"></path><path d="M555.836576 340.669261c29.086381 0 57.176654 5.677821 83.772763 16.933852 25.6 10.857588 48.610117 26.297276 68.333073 46.119844 19.822568 19.822568 35.262257 42.832685 46.119845 68.333074 11.256031 26.496498 16.933852 54.686381 16.933852 83.772763 0 29.086381-5.677821 57.176654-16.933852 83.772762-10.857588 25.6-26.297276 48.610117-46.119845 68.333074-19.822568 19.822568-42.832685 35.262257-68.333073 46.119845-26.496498 11.256031-54.686381 16.933852-83.772763 16.933852s-57.176654-5.677821-83.772763-16.933852c-25.6-10.857588-48.610117-26.297276-68.333074-46.119845-19.722957-19.822568-35.262257-42.832685-46.119844-68.333074-11.256031-26.496498-16.933852-54.686381-16.933852-83.772762s5.677821-57.176654 16.933852-83.772763c10.857588-25.6 26.297276-48.610117 46.119844-68.333074 19.822568-19.822568 42.832685-35.262257 68.333074-46.119844 26.596109-11.256031 54.686381-16.933852 83.772763-16.933852m0-49.108172c-145.929961 0-264.267704 118.337743-264.267704 264.267705S409.906615 820.196109 555.836576 820.196109 820.10428 701.858366 820.10428 555.828794 701.766537 291.561089 555.836576 291.561089z" p-id="3601" fill="#ffffff"></path><path d="M484.216342 387.087938c6.175875-6.175875 12.650584-11.953307 19.324514-17.232685-26.197665 9.562646-50.701946 24.803113-71.719844 45.821012-76.999222 76.999222-76.999222 202.010895 0 279.010116 23.308949 23.308949 51.000778 39.545525 80.286381 48.709728-9.761868-7.072374-19.125292-15.140856-27.891051-23.906615-91.741634-91.841245-91.741634-240.659922 0-332.401556zM992.331518 992.423346c-24.006226 24.006226-63.352529 24.006226-87.358755 0L728.362646 815.713619c-24.006226-24.006226-24.006226-63.352529 0-87.358755s63.352529-24.006226 87.358755 0l176.709727 176.709727c24.006226 24.006226 24.006226 63.352529-0.09961 87.358755z" p-id="3602" fill="#ffffff"></path></svg>
                  </button>
                </a>
                <a title="查看报名活动名单" th:onclick="member_lookUser(this,[[${list.activityId}]])" href="javascript:;">
                  <button class="layui-btn layui-btn-normal layui-btn-mini  layui-btn-xs" style="padding-top: 3px;">
                    <svg t="1662548207766" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3900" width="16" height="16"><path d="M320.06 255.58m28 0l328.07 0q28 0 28 28l0 0q0 28-28 28l-328.07 0q-28 0-28-28l0 0q0-28 28-28Z" p-id="3901" fill="#ffffff"></path><path d="M320.06 420.21m28 0l200.42 0q28 0 28 28l0 0q0 28-28 28l-200.42 0q-28 0-28-28l0 0q0-28 28-28Z" p-id="3902" fill="#ffffff"></path><path d="M888.35 320h-56.19V135.61a72 72 0 0 0-72-72H264a72 72 0 0 0-72 72V320h-55.79a72 72 0 0 0-72 72v496.22a72 72 0 0 0 72 72h752.14a72 72 0 0 0 72-72V392a72 72 0 0 0-72-72z m0 72v47.59c-0.53 0.27-1.05 0.56-1.57 0.86L832.16 472v-80zM264 135.61h496.16v377l-151.33 88.31-96.55 55.74L264 513.33V135.61zM192 392v79.77l-55.83-32.24V392z m-55.79 496.22V522.67l56.2 32.45 298 173A43 43 0 0 0 502 732.7a35.88 35.88 0 0 0 9.52 1.51h1.61a35.58 35.58 0 0 0 11.65-2.21 42.58 42.58 0 0 0 9-3.94L645 663.17l243.35-140.5v365.55z" p-id="3903" fill="#ffffff"></path></svg>
                  </button>
                </a>
                <a title="修改活动" th:onclick="member_update(this,[[${list.activityId}]])" href="javascript:;" th:if="${list.activityStatus} == 0">
                  <button class="layui-btn layui-btn-normal layui-btn-mini  layui-btn-xs" style="padding-top: 3px;">
                    <svg t="1662545056976" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2953" width="16" height="16"><path d="M684.202667 117.248c15.893333-15.872 42.154667-15.36 58.922666 1.408l90.517334 90.517333c16.661333 16.661333 17.344 42.986667 1.429333 58.922667l-445.653333 445.653333c-7.936 7.914667-23.104 16.746667-34.218667 19.776l-143.701333 39.253334c-21.909333 5.994667-35.114667-7.104-29.568-28.949334l37.248-146.773333c2.773333-10.944 11.562667-26.346667 19.392-34.176l445.653333-445.653333zM268.736 593.066667c-2.901333 2.901333-8.106667 12.074667-9.130667 16.021333l-29.12 114.773333 111.957334-30.570666c4.437333-1.216 13.632-6.549333 16.810666-9.728l445.653334-445.653334-90.517334-90.496-445.653333 445.653334zM682.794667 178.986667l90.517333 90.517333-30.186667 30.186667-90.496-90.517334 30.165334-30.165333z m-362.026667 362.048l90.496 90.517333-30.165333 30.165333-90.517334-90.496 30.165334-30.186666zM170.666667 874.666667c0-11.776 9.429333-21.333333 21.461333-21.333334h661.077333a21.333333 21.333333 0 1 1 0 42.666667H192.128A21.333333 21.333333 0 0 1 170.666667 874.666667z" fill="#ffffff" p-id="2954"></path></svg>
                  </button>
                </a>
                <a title="开始活动" th:onclick="member_updateStatus(this,[[${list.activityId}]],1)" href="javascript:;" th:if="${list.activityStatus} == 0">
                  <button class="layui-btn layui-btn-normal layui-btn-mini  layui-btn-xs" style="padding-top: 3px">
                    <svg t="1662545242916" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5131" width="16" height="16"><path d="M908.288 692.224a25.6 25.6 0 0 1-46.592-21.248 384 384 0 1 0-114.688 144.7424 25.6 25.6 0 0 1 31.3344 40.448 435.2 435.2 0 1 1 129.8944-163.9936zM359.6288 274.944a22.9376 22.9376 0 0 1 20.7872 25.7536A5727.232 5727.232 0 0 1 371.2 369.664h45.568a27.136 27.136 0 0 1 27.136 27.136c-3.072 81.92-16.384 152.576-39.936 212.992 22.528 23.552 41.472 45.056 55.808 64l-32.768 38.4c-12.8-17.408-27.648-35.328-45.056-54.784a370.1248 370.1248 0 0 1-54.528 75.9296 22.016 22.016 0 0 1-33.024-1.4336 27.2384 27.2384 0 0 1 1.792-36.0448c3.6864-3.7888 6.7584-7.0656 9.1648-9.8304 16.896-19.456 31.232-41.0112 43.3152-64.4608-19.968-20.48-41.472-41.984-65.024-64.512 11.264-43.008 22.016-90.112 31.232-140.8h-12.544a23.296 23.296 0 1 1 0-46.592H322.56a5615.9744 5615.9744 0 0 0 10.24-73.1136 24.9344 24.9344 0 0 1 26.88-21.6064z m9.472 299.52c16.384-46.592 26.624-99.328 29.696-158.208H363.52c-8.704 50.176-17.92 92.672-27.648 126.464 11.776 11.264 23.04 21.504 33.28 31.744z m344.064-29.696v194.048a10.24 10.24 0 0 1-10.24 10.24h-26.112a10.24 10.24 0 0 1-10.24-10.24v-18.432h-140.288v18.432a10.24 10.24 0 0 1-10.24 10.24h-25.6a10.24 10.24 0 0 1-10.24-10.24v-194.048c0-11.264 9.216-20.48 20.48-20.48h192c11.264 0 20.48 9.216 20.48 20.48z m-186.88 130.048h140.288v-105.984h-140.288v105.984zM462.848 486.912l-7.68-44.032c22.0672-7.168 52.1216-51.3536 90.112-132.7104l5.9904-13.1584a26.8288 26.8288 0 0 1 32.9216-14.3872 21.504 21.504 0 0 1 12.544 29.696l-5.376 11.0592c-22.4256 45.1584-44.9024 84.1216-68.096 116.4288 49.152-3.072 96.768-8.192 142.848-15.36a1052.3648 1052.3648 0 0 0-26.3168-51.0976 21.8112 21.8112 0 0 1 9.6768-30.0544 24.832 24.832 0 0 1 32.3584 10.0352l6.2976 11.1616a1332.992 1332.992 0 0 1 46.6944 93.5936 25.4464 25.4464 0 0 1-12.1344 33.4336 23.2448 23.2448 0 0 1-31.5392-11.9808 515.1744 515.1744 0 0 0-6.0928-14.1312c-66.56 9.216-140.8 16.384-222.208 21.504z" fill="#ffffff" p-id="5132"></path></svg>
                  </button>
                </a>
                <a title="结束活动" th:onclick="member_updateStatus(this,[[${list.activityId}]],2)" href="javascript:;" th:if="${list.activityStatus} == 1">
                  <button class="layui-btn layui-btn-danger layui-btn-mini  layui-btn-xs" style="padding-top: 3px">
                    <svg t="1662545317605" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7330" width="16" height="16"><path d="M678.528 642.304c0 17.6-14.4 32-32 32h-268.992a32 32 0 0 1-32-32V381.696a32 32 0 0 1 32-32h268.992c17.6 0 32 14.4 32 32v260.608z" p-id="7331" fill="#ffffff"></path><path d="M1015.552 512.128a502.656 502.656 0 0 0-503.68-503.68 502.208 502.208 0 0 0-356.096 147.264 502.016 502.016 0 0 0-147.328 356.416 500.288 500.288 0 0 0 146.816 356.736 499.584 499.584 0 0 0 356.544 146.688c277.312-2.816 503.744-226.24 503.744-503.424z m-947.968 0a444.288 444.288 0 0 1 444.288-444.544c246.976 0 447.296 200.128 447.296 444.544 0 244.032-200.32 444.416-447.296 444.416a442.304 442.304 0 0 1-444.288-444.416z" p-id="7332" fill="#ffffff"></path></svg>
                  </button>
                </a>
                <a title="删除活动" th:onclick="member_updateStatus(this,[[${list.activityId}]],3)" href="javascript:;" th:if="${list.activityStatus} != 3">
                  <button class="layui-btn layui-btn-danger layui-btn-mini  layui-btn-xs" style="padding-top: 3px">
                    <svg t="1662545372839" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1405" width="16" height="16"><path d="M928.16 144H736V64a32 32 0 0 0-32-32H320a32 32 0 0 0-32 32v80H95.84a32 32 0 0 0 0 64H129.6l77.92 698.656A96 96 0 0 0 302.912 992h418.144a96.032 96.032 0 0 0 95.424-85.344L894.4 208h33.728a32 32 0 0 0 0.032-64zM352 96h320v48H352V96z m400.896 803.552a32 32 0 0 1-31.808 28.448H302.912a32 32 0 0 1-31.808-28.448L193.984 208h636.032l-77.12 691.552z" p-id="1406" fill="#ffffff"></path><path d="M608 820.928a32 32 0 0 0 32-32V319.104a32 32 0 0 0-64 0v469.824a32 32 0 0 0 32 32zM432 820.928a32 32 0 0 0 32-32V319.104a32 32 0 0 0-64 0v469.824a32 32 0 0 0 32 32z" p-id="1407" fill="#ffffff"></path></svg>                  </button>
                </a>
              </td>
            </tr>
            </tbody>
          </table>
        </div>
        <!--<div class="layui-card-body ">
          <div class="page">
            <div>
              <a class="prev" href="">&lt;&lt;</a>
              <a class="num" href="">1</a>
              <span class="current">2</span>
              <a class="num" href="">3</a>
              <a class="num" href="">489</a>
              <a class="next" href="">&gt;&gt;</a>
            </div>
          </div>
        </div>-->
      </div>
    </div>
  </div>
</div>
</body>
<script  th:inline="javascript">
  layui.use(['laydate','form'], function(){
    var laydate = layui.laydate;
    var  form = layui.form;

    //执行一个laydate实例
    laydate.render({
      elem: '#start' //指定元素
    });

    //执行一个laydate实例
    laydate.render({
      elem: '#end' //指定元素
    });


  });

  /*修改*/
  function member_update(obj,id){
    $.ajax({
      url:'setActivity',
      method:'post',
      async:false,
      data:{'activityId':id},
    });
    xadmin.open('修改','updateActivityPage')
  }
  /*修改状态*/
  function member_updateStatus(obj,id,status) {
    layer.confirm('确认是否执行该操作？',function(index){
      $.ajax({
        url:'updateActivityStatus',
        method:'post',
        async:false,
        data:{'activityId':id,'activityStatus':status},
        success:function (data) {
          res=data;
        }
      });
      if (res=="1"){
        $(obj).parents("tr").remove();
        layer.msg('操作成功!',{icon:1,time:1000});
      }else {
        window.location.href="toErrorPage"
      }
    });
  }
  /*查看*/
  function member_look(obj,id){
    $.ajax({
      url:'setActivity',
      method:'post',
      async:false,
      data:{'activityId':id},
    });
    xadmin.open('活动详情','lookInfo')
  }
  /*查看报名名单*/
  function member_lookUser(obj,id){
    $.ajax({
      url:'setActivity',
      method:'post',
      async:false,
      data:{'activityId':id},
    });
    xadmin.open('活动报名名单','singList')
  }
  /*查询状态*/
  function pendingReview(status) {
    $.ajax({
      url:'setActivity',
      method:'post',
      async:false,
      data:{'status':status},
    });
    window.location.href='findAllActivityByStatus'
  }

  /*所有*/
  function allActivities() {
    window.location.href='findAllActivity'
  }
</script>
</html>